<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>商城商品管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">

		$(document).ready(function() {
			jp.ajaxForm("#inputForm",function(data){
				if(data.success){
				    jp.success(data.msg);
					jp.go("${ctx}/goodsstore/goodsStore");
				}else{
				    jp.error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			});

		});
	</script>
    <script src="${ctxStatic}/plugin/jquery-1.8.3.min.js"></script><!-- jQuery is required -->
    <script src="${ctxStatic}/plugin/city-picker/js/city-picker.data.js"></script>
    <script src="${ctxStatic}/plugin/city-picker/js/city-picker.js"></script>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/plugin/city-picker/css/city-picker.css"/>
</head>
<body>
<div class="wrapper wrapper-content">				
<div class="row">
	<div class="col-md-12">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title"> 
				<a class="panelButton" href="${ctx}/goodsstore/goodsStore"><i class="ti-angle-left"></i> 返回</a>
			</h3>
		</div>
		<div class="panel-body">
		<form:form id="inputForm" modelAttribute="goodsStore" action="${ctx}/goodsstore/goodsStore/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
				<div class="form-group">
					<label class="col-sm-2 control-label">商品名称：</label>
					<div class="col-sm-10">
						<form:input path="name" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">轮播图：</label>
					<div class="col-sm-10">
						<sys:fileUpload path="mainImgs"  value="${goodsStore.mainImgs}" type="image" fileNumLimit="1" uploadPath="/goodsstore/goodsStore"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">所需余额：</label>
					<div class="col-sm-10">
						<form:input path="price" htmlEscape="false"  placeholder="时令专区商品可填写"   class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">所需积分：</label>
					<div class="col-sm-10">
						<form:input path="integral" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<%--<div class="form-group">--%>
					<%--<label class="col-sm-2 control-label">原价：</label>--%>
					<%--<div class="col-sm-10">--%>
						<%--<form:input path="originalPrice" htmlEscape="false"    class="form-control "/>--%>
					<%--</div>--%>
				<%--</div>--%>
				<div class="form-group">
					<label class="col-sm-2 control-label">详情图：</label>
					<div class="col-sm-10">
						<sys:fileUpload path="imgs"  value="${goodsStore.imgs}" type="image" uploadPath="/goodsstore/goodsStore"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">商品状态：</label>
					<div class="col-sm-10">
						<form:select path="goodsStatus" class="form-control ">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('goods_store_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</div>
				</div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">地区：</label>
                    <div class="col-sm-10" style="position: relative;">
                        <form:input path="goodsPosition" htmlEscape="false"  data-toggle="city-picker"  class="form-control "/>
                    </div>
                </div>
				<%--<div class="form-group">--%>
					<%--<label class="col-sm-2 control-label">一级返利：</label>--%>
					<%--<div class="col-sm-10">--%>
						<%--<form:input path="firstProfit" htmlEscape="false"    class="form-control "/>--%>
					<%--</div>--%>
				<%--</div>--%>
				<%--<div class="form-group">--%>
					<%--<label class="col-sm-2 control-label">二级返利：</label>--%>
					<%--<div class="col-sm-10">--%>
						<%--<form:input path="secondProfit" htmlEscape="false"    class="form-control "/>--%>
					<%--</div>--%>
				<%--</div>--%>
				<div class="form-group">
					<label class="col-sm-2 control-label">分区：</label>
					<div class="col-sm-10">
						<sys:gridselect url="${ctx}/zone/zone/data" id="zone" name="zone.id" value="${goodsStore.zone.id}" labelName="zone.name" labelValue="${goodsStore.zone.name}"
							 title="选择分区id" cssClass="form-control " fieldLabels="分区名" fieldKeys="name" searchLabels="分区名" searchKeys="name" ></sys:gridselect>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">已售件数：</label>
					<div class="col-sm-10">
						<form:input path="boughtPerson" htmlEscape="false"    class="form-control  isIntGtZero"/>
					</div>
				</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">库存：</label>
				<div class="col-sm-10">
					<form:input path="stock" htmlEscape="false"    class="form-control  isIntGteZero"/>
				</div>
			</div>
		<c:if test="${mode == 'add' || mode=='edit'}">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <div class="form-group text-center">
		                 <div>
		                     <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		                 </div>
		             </div>
		        </div>
		</c:if>
		</form:form>
		</div>				
	</div>
	</div>
</div>
</div>
</body>
</html>